package com.hzdl.flower.controller;

import com.hzdl.flower.bean.User;
import com.hzdl.flower.service.AuserService;
import com.hzdl.flower.service.UserService;
import com.hzdl.flower.util.HZDLJsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("stat")
public class AddressController {
    @Autowired
    private AuserService aus;


    @RequestMapping("addressInit")

    public String addressInit(){
        return "admin/address";
    }

    @RequestMapping("getAddress")
    @ResponseBody

    public HZDLJsonResult getAddress(){
        List<User> users = aus.statAddress();
        return HZDLJsonResult.ok(users);
    }
}
